//
// Created by bxw57 on 2024/6/16.
//
#include <iostream>
#include "MeasureTime.hpp"
#include "ParallelAccumulate.hpp"

int main() {
    std::vector<int> data(100000000, 1); // 创建一个包含10000个元素，每个元素都是1的向量
    int init = 0; // 初始值为0

    double time1 = measureTime(parallel_accumulate<std::vector<int>::iterator, int>, data.begin(), data.end(), init);
    double time2 = measureTime(std::accumulate<std::vector<int>::iterator, int>, data.begin(), data.end(), init);

    std::cout << "parallel_accumulate time: " << time1 << " ms" << std::endl;
    std::cout << "accumulate time: " << time2 << " ms" << std::endl;

    return 0;
}